package com.legrand.www.module.worker.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

import javax.sql.DataSource;

/**
 * 数据源配置
 */
//@Configuration
public class DataSourceConfig {

       //@Bean(name = "dataSource")
       //@ConfigurationProperties(prefix = "spring.datasource")
       /*使用的数据源*/
       public DataSource dataSource() {
              return new DriverManagerDataSource();
       }

       // 配置事物管理器
       //@Bean(name = "transactionManager")
       public DataSourceTransactionManager transactionManager() {
              return new DataSourceTransactionManager(dataSource());
       }

}
